<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <h1 ref="box">{{message}}{{num}}</h1>
        <button @click="changeNum">点击</button>
    </div>
    <script>
        // nextTick ：在vue渲染完毕之后 执行回调
        new Vue({
            el:"#app",
            data:{
                message:"数据",
                num:1
            },
            created:function(){
                // console.log(this.$refs.box)
                // this.$nextTick(()=>{
                //     console.log(this.$refs.box)
                // })
            },
            methods:{
                changeNum(){
                    this.num++;
                    // console.log(this.$refs.box.innerHTML);
                    // this.$nextTick(()=>{
                    //     console.log(this.$refs.box.innerHTML);
                    // })
                    // setTimeout(() => {
                    //     console.log(this.$refs.box.innerHTML);
                    // });
                }
            }
        })


    </script>
</body>
</html>